<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>

<body>
  <script>
    new Promise(function (resolve, reject) {
      setTimeout(function () {
        resolve(console.log(123))
      }, 3000)
      if(1) {
        reject('我错了')
      }
    })
    .then((res) => {
      console.log(res)
    })
    .catch((err) => {
      throw new Error(err)
    })

  </script>
</body>

</html>
